#pragma once

#pragma unmanaged

#include <BWSAL\ReservedMap.h>

#pragma managed

#include "..\AiBase.h"
#include "Interfaces\IReservedMap.h"

namespace BroodWar
{
	namespace Addon
	{
		public ref class ReservedMap : public AiBase, IReservedMap
		{
		internal:
			BWSAL::ReservedMap* instance;

			ReservedMap();
			ReservedMap(BWSAL::ReservedMap* map);
			~ReservedMap();
			!ReservedMap();

			static ReservedMap^ s_instance;
		public:
			static property ReservedMap^ Instance { ReservedMap^ get(); }

			virtual void ReserveTiles(TilePosition^ position, Api::Enum::UnitType type, int width, int height);
			virtual void ReserveTiles(TilePosition^ position, Api::Enum::UnitType type, int width);
			virtual void ReserveTiles(TilePosition^ position, Api::Enum::UnitType type);
			virtual void FreeTiles(TilePosition^ position, int width, int height);
			virtual void FreeTiles(TilePosition^ position, int width);
			virtual void FreeTiles(TilePosition^ position);
			virtual bool IsReserved(int x, int y);
			virtual bool IsReserved(TilePosition^ p);
			virtual bool CanBuildHere(Unit^ builder, TilePosition^ position, Api::Enum::UnitType type);
			virtual Api::UnitType^ GetReservedType(int x, int y);
			virtual Api::UnitType^ GetReservedType(TilePosition^ p);
		};

		BWSAL::ReservedMap* ConvertReservedMap(ReservedMap^ map);
		ReservedMap^ ConvertReservedMap(BWSAL::ReservedMap* map);
	}
}
